

var arr = ['red', 'green'];
arr.push('blue');

// travels for each
arr.forEach(function(item) {
	console.log(item);
});
console.log('Array.isArray(arr) = ' + Array.isArray(arr));

// filter
var arr2 = arr.filter(function(item, index, array) {
	return index > 1;
});
console.log(arr2);

// mapping to a new array
var arr3 = arr.map(function(item, index, array) {
	return item + '-1'
});
console.log(arr3);

// reduce
var obj4 = arr.reduce(function(item, preValue) {
	return preValue + "-" + item;
});
console.log(obj4);